package com.jianbing.timer;

import net.sf.json.JSONObject;
import org.apache.log4j.Logger;

import com.jianbing.util.HttpClient;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * 定时同步城市配置
 * 
 * @author cwl
 * @date 2017年5月19日
 *
 */
public class CitySetting {

	private static Logger logger = Logger.getLogger(CitySetting.class);

	public static final Map<String, Object> thxdCityMap = new HashMap<String, Object>();

	public static final Map<String, Object> gjjCityMap = new HashMap<String, Object>();

	public void getThxdCitySetting() {
		try {
			String s = HttpClient.get("http://120.26.204.133:4829/thxdServices/queryThxdCitySettings");
			JSONObject json = JSONObject.fromObject(s);
			thxdCityMap.put("thxdCity", json.get("data"));
		} catch (Exception e) {
			logger.error("同步通话详单城市配置出错:" + e.getMessage(), e);
		}
	}

	public void getGjjCitySetting() {
		try {
			String s = HttpClient.get("http://120.26.204.133:4821/gjjServices/queryGjjCitySettings");
			JSONObject json = JSONObject.fromObject(s);
			gjjCityMap.put("thxdCity", json.get("data"));
		} catch (Exception e) {
			logger.error("同步公积金城市配置出错:" + e.getMessage(), e);
		}
	}
}